<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
 <script type="text/javascript">
 function saveAdminPwd()
 {
 	$('#divNewPwd').html('');
 	$('#divConfPwd').html('');
 	var admin_id = $('#admin_id').val();
 	var new_pwd = $('#new_pwd').val();
 	if($('#new_pwd').val()=='')
 	{
 		$('#divNewPwd').html('New Password required');
 		$('#divNewPwd').show('slow');
 		$('#new_pwd').focus();
 		return false;
 	}
 	else if($('#conf_pwd').val()=='')
 	{
 		$('#divConfPwd').html('Confirm Password required');
 		$('#divConfPwd').show('slow');
 		$('#conf_pwd').focus();
 		return false;
 	}
 	else if($('#new_pwd').val()!=$('#conf_pwd').val())
 	{
 		$('#divConfPwd').html('Both passwords must be same');
 		$('#divConfPwd').show('slow');
 		$('#conf_pwd').select();
 		return false;
 	}
 	else
 	{
    $.ajax({
					type: "POST",
				   	dataType: "json",
				   	url: "/admin-mvc/index/index/save-admin-pwd",
				   	data: "admin_id="+admin_id+"&new_pwd="+new_pwd,
				   	success: function(data){
				   		alert("Password changed");
				   		location.href='/admin-mvc/games';
			   	    }
		});
	}
 }
  </script>
</head>

<body>
<form name="csvForm" action="" method="post">
<table  align="center" width="80%" border="0" cellpadding="5"><tr><td>&nbsp;</td></tr>
<input type="hidden" name="admin_id" id="admin_id" value="<?php echo $ctx->admin_id; ?>" />
<tr><td colspan="3"><strong>Change Password for Admin</strong></td></tr>
<tr><td colspan="3">&nbsp;</td></tr>
<tr><td width="25%" align="right"><span class="mandatory">*</span>New Password</td><td width="25%"><input type="password" name="new_pwd" id="new_pwd" /></td><td width="50%"><span id="divNewPwd" class="validationError"></span></td></tr>
<tr><td align="right"><span class="mandatory">*</span>Confirm Password</td><td><input type="password" name="conf_pwd" id="conf_pwd" /></td><td><span id="divConfPwd" class="validationError"></span></td></tr>
<tr><td colspan="3">&nbsp;</td></tr>

<tr><td>&nbsp;</td><td colspan="2"><input type="button" name="submit" value="Submit" onClick="saveAdminPwd();" /></td></tr>
</table>
</form>



</body>
</html>
